export default {
	// 为当前模块开启命名空间
	namespaced: true,

	// 模块的 state 数据
	state: {
		balance: uni.getStorageSync('balance') || "0.00", //余额
		appraise:JSON.parse(uni.getStorageSync('appraise') || "[]") , //余额
	},

	// 模块的 mutations 方法
	mutations: {
		//添加余额
		addBalance(state, meney) {
			state.balance = (parseFloat(state.balance) + parseFloat(meney)).toFixed(2)
			uni.setStorageSync("balance", state.balance)

		},
		//添加评论
		addAppraise(state, assess) {
			state.appraise.push(assess)

			uni.setStorageSync("appraise",JSON.stringify(state.appraise))
		},
	},

	// 模块的 getters 属性
	getters: {
		getBalance(state) {
			return state.balance
		},
		getAppraise(state) {
			return state.appraise
		},
	},
}